#ifndef _PROTOCOL_H_
#define _PROTOCOL_H_

#define HEGEMONY_VERSION_MAJOR	1
#define HEGEMONY_VERSION_MINOR  0

#define MSG_ERROR	0
#define MSG_WELCOME	1
#define REQ_VERSION	2
#define RSP_VERSION	3
#define REQ_LOGIN	4
#define RSP_LOGIN	5
#define REQ_PING	6
#define RSP_PONG	7
#define MSG_CHAT	8
#define MSG_WARNING	9
#define MSG_UNKNOWN	10

struct MessageHeader {

	char Type;
	int Length;

};

typedef struct MsgWelcome : public MessageHeader {

	char Text [256];

} MsgError, MsgWarning, MsgChat;

typedef struct ReqVersion : public MessageHeader {

} MsgUnknown, ReqPing, ReqPong; 

struct RspVersion : public MessageHeader {

	char Major, Minor;

};

struct ReqLogin : public MessageHeader {

	char Login [16];

};

#define RSP_LOGIN_OK	 0
#define RSP_LOGIN_BAD	 1
#define RSP_LOGIN_USED	 2

struct RspLogin : public MessageHeader {

	char Response;

};


#endif
